Repository navigation
Conversation
The per-user columns of reports, report runs and budget-window runs, and the report runs' cliff columns, go in a new revision. Report reads stop answering a run's trigger, the privilege manifest stops naming the cliff columns, and account deletion needs no reports.user_id. Rows the tests store at the head revision stop naming the columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revision 4e30076d4b9f drops reports.label, description and user_id, report_runs.trigger and its four cliff columns, and budget_window_runs.trigger, with the foreign key, index and check that depend on them. The downgrade adds them back empty. /v2/reports run items no longer have a trigger, the Modal worker's grants no longer name the cliff columns, and account deletion no longer touches reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c1-41-drop-report-columns # Conflicts: # policyengine_api/data/v2/models/reports.py # policyengine_api/data/v2/models/users.py # tests/integration/test_v2_report_cliff_reads.py
The revision's tests compare it and its downgrade with the parent schema built from the base, and CI's migration lifecycle job runs them. A test assertion that could not fail goes, and the privilege docstring and the migration guide say what must happen before merging and after a downgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c1-41-drop-report-columns
The revision gets its generation command and a description, the privilege test starts from the Modal worker's old cliff grants, the workflow test pins the new lifecycle module, and the downgrade guides say that going below the shared reports revision needs no reports or runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2plan/c1-40a-stop-mapping-report-columns #4335 +/- ##
==========================================================================
Coverage 93.61% 93.62%
==========================================================================
Files 409 409
Lines 23352 23349 -3
Branches 3656 3656
==========================================================================
- Hits 21862 21861 -1
+ Misses 875 874 -1
+ Partials 615 614 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The reports cases of test_a_malformed_or_incomplete_key_is_refused still named label, which revision 4e30076d4b9f drops, so they failed on the missing column instead of the key check. Each case now also names the check constraint it expects, so a refusal by a different check fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c1-41-drop-report-columns # Conflicts: # docs/engineering/skills/alembic-migrations.md
…c1-41-drop-report-columns # Conflicts: # docs/migration/stage-12a-user-login.md # docs/migration/stage-9-v2-metadata.md # tests/unit/v2/test_alembic_v2_revisions.py
Merging the dynamics revision through C1 · 40a brought back the cliff impacts test's head assertion, which this branch had removed: revision 4e30076d4b9f is the head, and the chain test already asserts that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4334
Summary
Adds v2 revision
4e30076d4b9f, onbc334f9877b7. It drops:reportslabel,description,user_idfk_reports_user_id_users,ix_reports_user_idreport_runstrigger,baseline_cliff_gap,baseline_cliff_share,reform_cliff_gap,reform_cliff_shareck_report_runs_cliff_impact_completebudget_window_runstriggerUPDATEon the four cliff columns goes.reports.v2_report_run_triggerstays, foruser_report_run_associations.budget_window_runs.recalculatestays.The drops can't be undone by a downgrade
The downgrade adds the columns, key, index and check back with every value null. Nothing copies the values first, because these rows name no user to copy them to.
Before merging, an operator exports the stored values from staging and from production, and keeps the result outside this repository, because labels and descriptions are users' text. These queries only read:
What must be in production before this merges
The release workflow upgrades the v2 schema before the new Cloud Run revision takes traffic, so the release already serving runs on the dropped schema.
/v2/reportsread fails during the deploy.mainstill writes the four cliff columns, so without it every economy report run's completion fails.C1 · 42 follows: the simulation service's table models lose these columns and its pinned API v1 commit moves to this merge. Until then its schema comparison fails against this schema; requests are not affected.
Migration notes
/v2/reports. This PR changes no HTTP response; Stop mapping the report columns the next v2 revision drops #4333 removedtrigger..github/scripts/test_alembic_v2_lifecycle.shgains the new test module. It reads no new environment variable:V2_MIGRATION_DATABASE_URL,V2_ALEMBIC_DISPOSABLE_TESTandUV_PYTHONare literal values inalembic-v2-check.yml's jobenv.Testing
alembic -c alembic-v2.ini checkfinds nothing to generate, andreconcile_v2_privileges.py applyandverifypass./readyprivilege check finds nothing missing.lint-imports,python -m scripts.rules validate,run_quality_guards.pyandmake typecheck-v2pass. Explicit mypy on the changedpolicyengine_api/data/v2/files adds no error to the base branch's.🤖 Generated with Claude Code